New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log the request path of a failed request in the ErrorMiddleware. #2170
Conversation
@maciejtrybilo could you add a test to show the path being logged? The only difference I can see is that this logs the path of every failed request, not just a 404. But I actually quite like that! |
@0xTim Yep, that's why I've opened a separate PR as the functionality is a little different. Added some tests. Let me know what you think! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 this approach is much better, thank you.
Thanks for the comments @tanner0101 Let me know anything else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks @maciejtrybilo !
@maciejtrybilo thanks for the PR! From what I looked now, it seems that in |
@natanrolnik yeah that's true. An issue for Vapor 4 specifically would be appreciated. |
Added the request path to the logging from the
ErrorMiddleware
. For instance when a resource/hello/vapor
cannot be found currently the log will readAbort.404: Not Found
. After this change the log will readAbort.404: /hello/vapor Not Found
which will improve monitoring.